<?php 
$page_index = (int) $this->get_data('page_index');
$page_count = (int) $this->get_data('page_count');
$base_url = $this->get_data('base_url');
?>
<?php if ($page_count > 1):?>
<ul id="pagination">
<?php if ($page_count <= 11):?>
<?php for ($i = 1; $i <= $page_count; $i ++):?>
<li>
<?php 
$href = $base_url;
if ($base_url) {
    $href = tos_router_url(array('url'=>$base_url . '/' . $i));
} else {
    $href = tos_router_url(array('page'=>$i), false);
}
?>
<a<?php echo ($i == $page_index) ? ' class="current"' : '';?> href="<?php echo $href;?>"><?php echo $i;?></a>
</li>
<?php endfor;?>
<?php else:?>
<?php // todo later?>
<?php endif;?>
</ul>
<?php endif;?>